<h1>Listing events</h1>

<table>
  <tr>
    <th>Name</th>
    <th>Location</th>
    <th>Time</th>
	<th>Equipment Status</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @events.each do |event| %>
  <tr>
    <td><%= event.name %></td>
    <td><%= event.location %></td>
    <td><%= event.time %></td>
	<td style="color:<%=event.status.color%>"><b><%= event.status.name %></b></td>
    <td><%= link_to 'Show', event %></td>
    <td><%= link_to 'Edit', edit_event_path(event) %></td>
    <td><%= link_to 'Destroy', event, method: :delete, data: { confirm: 'Are you sure?' } %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'Home', root_path %> |
<%= link_to 'New Event', new_event_path %>
